import os
from openai import OpenAI
import requests
import time
import json
import time

API_SECRET_KEY = "sk-zk240510f89f6c6688f5cf35c2950ca48306836c62017a9f";
BASE_URL = "https://api.zhizengzeng.com/v1/"

model_list = {
    '百度文心一言': 'ernie-4.5-turbo-vl-32k',
    '腾讯混元': 'hunyuan-13B',
    '阿里通义千问': 'qwen3-235b-a22b'
}

# chat with other model
def chat_completions(query):
    client = OpenAI(api_key=API_SECRET_KEY, base_url=BASE_URL)
    resp = client.chat.completions.create(
        model=model_list['百度文心一言'],
        messages=[
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": query}
        ]
    )
    print(resp)
    print(resp.choices[0].message.content)
    
if __name__ == '__main__':
    chat_completions("你是哪个公司开发的什么模型？");